<template>
	<view class="page_wrapper page_bg">
		<view v-html="article.content" class="article_detail"></view>
	</view>
</template>

<script>
	import {request} from '@/utils/request.js'
	import {storageData} from '@/utils/storageData.js'
	export default {
		data() {
			return {
				articleNo: '',
				article: {}
			}
		},
		onLoad(options) {
			this.articleNo = options.articleNo
			uni.showLoading()
			// request.get(
			// 	'/articles/no,' + this.articleNo, {}
			// ).then(res => {
			// 	uni.hideLoading()
			// 	this.article = res
			// 	uni.setNavigationBarTitle({
			// 		title: this.article.title
			// 	})
			// }).catch(err => {
			// 	uni.hideLoading()
			// 	console.log(err)
			// })
		},
		onShareAppMessage(res) {
			const userInfo = storageData.getLoginUser()
			if (res.from === 'button') {
					 // 来自页面内分享按钮
					 console.log(res.target);
			}
			return {
				title: '萌芽数学应用精选',
				path: '/pages/index/index?shareUc=' + userInfo.userCode,
				mpId: 'wx69f28fc27b2a04d0', //此处配置微信小程序的AppId
				imageUrl: 'https://www.hzif.cn/mathematics-attach/share.png'
			}
		},
		onShareTimeline(res) {
			const userInfo = storageData.getLoginUser()
			return {
				title: '萌芽数学应用精选',
				path: '/pages/index/index?shareUc=' + userInfo.userCode,
				mpId: 'wx69f28fc27b2a04d0', //此处配置微信小程序的AppId
				imageUrl: 'https://www.hzif.cn/mathematics-attach/share.png'
			}
		}
	}
</script>

<style lang="scss">
	.page_wrapper{
		.article_title{
			font-size: 17px;
			font-weight: 500;
			margin: 15px 15px 0px 15px;
			text-align: center;
		}
		.article_detail{
			margin: 15px;
			padding: 30px 15px;
			background-color: white;
		}
	}
</style>
